<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">

    <title>申请记录</title>

    <meta name="keywords" content="">
    <meta name="description" content="">

    <!--[if lt IE 8]>
    <script>
        alert('H+已不支持IE6-8，请使用谷歌、火狐等浏览器\n或360、QQ等国产浏览器的极速模式浏览本页面！');
    </script>
    <![endif]-->

    <link href="/static/admin/public/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
    <link href="/static/admin/public/css/font-awesome.min.css?v=4.3.0" rel="stylesheet">
    <link href="/static/admin/public/css/animate.min.css" rel="stylesheet">
    <link href="/static/toastr/toastr.min.css" rel="stylesheet"></link>
    <link href="/static/admin/public/css/style.min.css?v=3.2.0" rel="stylesheet">
    <link href="/static/admin/plugins/jsTree/css/style.min.css" rel="stylesheet">
</head>

<body class="fixed-sidebar full-height-layout gray-bg">
<div class="wrapper wrapper-content animated fadeInRight" id="contentList">
    <div class="ibox float-e-margins" >

        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5 class="pull-left">申请列表</h5>
                <div class="pull-right">
                    <a href="javascript:window.history.back()" class="btn btn-link">返回</a>
                </div>

            </div>
            <div class="ibox-content">
                <table class="table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>公告标题</th>
                        <th>添加时间</th>
                        <th>更新时间</th>

                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr v-for="(item,index) in list">
                        <td>{{(((current_page-1)*num)+index)+1}}</td>
                        <td>{{item.member_info_name}}</td>
                        <td>{{item.create_time}}</td>
                        <td>{{item.update_time}}</td>
                        <td>
                            <div role="group" aria-label="..." class="btn-group">
                                <a v-bind:href="'/admin/member/detail/id/'+item.id" type="button" class="btn btn-warning btn-xs">查看</a>
                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="ibox-content text-center">
                <div class="btn-group">
                    <button type="button" class="btn btn-white" @click="pageNextList(-1)"><i class="fa fa-chevron-left"></i>
                    </button>

                    <button class="btn" @click="pageNumGetList(item)" v-bind:class="pageInfo.current_page==item?'btn-primary':'btn-white'" v-for="item in pageInfo.total">{{item}}</button>
                    <!--                        <button class="btn btn-white  active">2</button>-->
                    <button type="button" class="btn btn-white"><i class="fa fa-chevron-right" @click="pageNextList(1)"></i>
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="/static/admin/public/js/jquery-2.1.1.min.js"></script>
<script src="/static/admin/public/js/bootstrap.min.js?v=3.4.0"></script>
<script src="/static/admin/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/static/admin/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/static/admin/plugins/layer/layer.min.js"></script>
<script type="text/javascript" src="/static/vue/vue.js"></script>

<!-- 自定义js -->
<script type="text/javascript" src="/static/util/axios.min.js"></script>
<script type="text/javascript" src="/static/admin/api/require.js"></script>
<script type="text/javascript" src="/static/admin/api/publicAjax.js"></script>

<!-- 第三方插件 -->
<script src="/static/toastr/toastr.min.js"></script>
<script src="/static/toastr/customToastr.js"></script>
<script src="/static/admin/plugins/jsTree/js/jstree.min.js"></script>
<script>
    var id = '{$id}'
    var vmAddChannel = new Vue({
        el:"#contentList",
        data:{
            "list":[],
            "pageInfo":{},
            "current_page":1,
            "num":5,
            'id':id
        },
        methods:{
            pageNumGetList:function(page){
                var el = this
                el.current_page = page
                el.getList()
            },
            pageNextList:function (num) {
                var el = this;
                var set_current_page = el.current_page*1+num
                // el.current_page = el.pageInfo.current_page*1+num
                console.log(el.current_page)
                if( set_current_page < 1){
                    $.customToastr("error","已经是第一页啦");
                    return;
                }
                if(set_current_page > el.pageInfo.total){
                    $.customToastr("error","已经是最后一页啦");
                    return;
                }
                el.current_page = set_current_page
                el.getList();
            },
            //条件更改无法从第一页查询，跳转方法
            changeWhereGetList:function(){
                var el = this
                el.current_page = 1
                el.getList()
            },
            getList:function () {
                let el = this
                let postData = {
                    'current_page':el.current_page,
                    'num':el.num,
                    'id':el.id
                }
                AjaxPost(postData,'/admin/freight/getApplyMemberList').then((response)=>{
                    if(response.result.list){
                        el.list = response.result.list
                    }
                    console.log(response)
                })
            },
        },
        mounted(){
            this.getList();
        }

    })
</script>

</body>

</html>